﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace LastfmNet.Models
{
    public class Price : LastfmModelBase
    {
        public Price()
        {
            this.Amount = 0;
            this.Currency = string.Empty;
        }

        public Price(XmlNode priceNode)
            : this()
        {
            if (priceNode == null) return;
            this.InitializeFromXmlNode(priceNode);
        }

        public override void InitializeFromXmlNode(XmlNode node)
        {
            if (node == null) return;
            this.Amount = node.GetChildValue("amount").ToDecimal();
            this.Currency = node.GetChildValue("currency");
        }

        public decimal Amount
        {
            get;
            set;
        }

        public string Currency
        {
            get;
            set;
        }
    }
}
